home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 11 / FM Towns Free Software Collection 11.iso / t_os / tool / dolmorph / src / dumpimg.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-07  |  636 b   |  39 lines

  1. /*
  2.     dumpimg.c
  3.  
  4.     ベタで出力された3万色画像データを画面に表示
  5. */
  6.  
  7. #include <stdio.h>
  8. #include <conio.h>
  9. #include <ryosuke.h>
  10. #include <usrlib.h>
  11.  
  12. int main(int argc, char *argv[])
  13. {
  14.     FILE *fp;
  15.     int width, height;
  16.     if (argc < 4)
  17.     {
  18.         printf("usage: dumpimg <filename> <xlen> <ylen>");
  19.         exit(0);
  20.     }
  21.     width = atoi(argv[2]);
  22.     height = atoi(argv[3]);
  23.     ginit();
  24.     gscreen(17);
  25.     if ((fp = fopen(argv[1], "rb")) != NULL)
  26.     {
  27.         int i,j;
  28.         for (i=0; i<height; i++)
  29.         {
  30.             char linebuf[3000];
  31.             fread(linebuf, 2, width, fp);
  32.             gputblk(linebuf, 0, i, width, 1, 0);
  33.         }
  34.         fclose(fp);
  35.     }
  36.     _getche();
  37.     return 0;
  38. }
  39.